package cn.kgc.springbootdemo.form;

import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.Size;
import java.io.Serializable;
import java.time.LocalDate;

/**
 * <h3>springbootdemo</h3>
 * <p>用户表单</p>
 *
 * @author : DongZeJian
 * @date : 2020-04-27 20:03
 **/
@Data
@ApiModel("添加用户form对象")
public class UserForm implements Serializable {
    private static final long serialVersionUID = 1L;

    /**
     *  用户账号
     */
    @ApiModelProperty(value = "用户账号",name = "userCode",required = true)
    @NotBlank(message = "用户账号不能为空")
    private String userCode;

    /**
     * 用户密码
     */
    @ApiModelProperty(value = "密码",name = "passwrod",required = true)
    @NotBlank(message = "密码不能为空")
    @Size(min = 6,max = 32,message = "长度必须大于等于6小于32位")
    private String passwrod;

    /**
     * 用户名称
     */
    @ApiModelProperty(value = "用户名称",name ="userName",required = true)
    @NotBlank(message = "用户名称不能为空")
    private String userName;

    /**
     * 性别
     */
    @ApiModelProperty(value = "性别1是男 2是女",name = "sex")
    @NotBlank(message = "用户性别不能为空")
    private String sex;

    /**
     * 角色
     */
    @ApiModelProperty(value = "角色",name = "role")
    private String role;

    /**
     * 资金
     */
    @ApiModelProperty(value = "资金",name = "money")
    private Double money=0.0;

    /**
     * 电话号码
     */
    @ApiModelProperty(value = "电话号码",name = "phone")
    @Size(max = 11,message = "请核实手机号码不能超过11位")
    private String phone;

    /**
     * 出生日期
     */
    @ApiModelProperty(value = "出生日期",name = "birth")
    private LocalDate birth;

}
